USE [master]
GO

-- Create the facebook database: [FBDatabase] 
CREATE DATABASE [FBDatabase] ON  PRIMARY 
( NAME = N'FBDatabase', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\FBDatabase.mdf' , SIZE = 2048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'FBDatabase_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\FBDatabase_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO

ALTER DATABASE [FBDatabase] SET COMPATIBILITY_LEVEL = 100
GO

IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [FBDatabase].[dbo].[sp_fulltext_database] @action = 'disable'
end
GO

ALTER DATABASE [FBDatabase] SET ANSI_NULL_DEFAULT OFF 
GO

ALTER DATABASE [FBDatabase] SET ANSI_NULLS OFF 
GO

ALTER DATABASE [FBDatabase] SET ANSI_PADDING OFF 
GO

ALTER DATABASE [FBDatabase] SET ANSI_WARNINGS OFF 
GO

ALTER DATABASE [FBDatabase] SET ARITHABORT OFF 
GO

ALTER DATABASE [FBDatabase] SET AUTO_CLOSE OFF 
GO

ALTER DATABASE [FBDatabase] SET AUTO_CREATE_STATISTICS ON 
GO

ALTER DATABASE [FBDatabase] SET AUTO_SHRINK OFF 
GO

ALTER DATABASE [FBDatabase] SET AUTO_UPDATE_STATISTICS ON 
GO

ALTER DATABASE [FBDatabase] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO

ALTER DATABASE [FBDatabase] SET CURSOR_DEFAULT  GLOBAL 
GO

ALTER DATABASE [FBDatabase] SET CONCAT_NULL_YIELDS_NULL OFF 
GO

ALTER DATABASE [FBDatabase] SET NUMERIC_ROUNDABORT OFF 
GO

ALTER DATABASE [FBDatabase] SET QUOTED_IDENTIFIER OFF 
GO

ALTER DATABASE [FBDatabase] SET RECURSIVE_TRIGGERS OFF 
GO

ALTER DATABASE [FBDatabase] SET  ENABLE_BROKER 
GO

ALTER DATABASE [FBDatabase] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO

ALTER DATABASE [FBDatabase] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO

ALTER DATABASE [FBDatabase] SET TRUSTWORTHY OFF 
GO

ALTER DATABASE [FBDatabase] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO

ALTER DATABASE [FBDatabase] SET PARAMETERIZATION SIMPLE 
GO

ALTER DATABASE [FBDatabase] SET  READ_WRITE 
GO

ALTER DATABASE [FBDatabase] SET RECOVERY FULL 
GO

ALTER DATABASE [FBDatabase] SET  MULTI_USER 
GO

ALTER DATABASE [FBDatabase] SET PAGE_VERIFY CHECKSUM  
GO

ALTER DATABASE [FBDatabase] SET DB_CHAINING OFF 
GO

ALTER DATABASE [FBDatabase] SET ANSI_NULL_DEFAULT OFF 
GO

ALTER DATABASE [FBDatabase] SET ANSI_NULLS OFF 
GO

ALTER DATABASE [FBDatabase] SET ANSI_PADDING OFF 
GO

ALTER DATABASE [FBDatabase] SET ANSI_WARNINGS OFF 
GO

ALTER DATABASE [FBDatabase] SET ARITHABORT OFF 
GO

ALTER DATABASE [FBDatabase] SET AUTO_CLOSE OFF 
GO

ALTER DATABASE [FBDatabase] SET AUTO_CREATE_STATISTICS ON 
GO

ALTER DATABASE [FBDatabase] SET AUTO_SHRINK OFF 
GO

ALTER DATABASE [FBDatabase] SET AUTO_UPDATE_STATISTICS ON 
GO

ALTER DATABASE [FBDatabase] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO

ALTER DATABASE [FBDatabase] SET CURSOR_DEFAULT  GLOBAL 
GO

ALTER DATABASE [FBDatabase] SET CONCAT_NULL_YIELDS_NULL OFF 
GO

ALTER DATABASE [FBDatabase] SET NUMERIC_ROUNDABORT OFF 
GO

ALTER DATABASE [FBDatabase] SET QUOTED_IDENTIFIER OFF 
GO

ALTER DATABASE [FBDatabase] SET RECURSIVE_TRIGGERS OFF 
GO

ALTER DATABASE [FBDatabase] SET  ENABLE_BROKER 
GO

ALTER DATABASE [FBDatabase] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO

ALTER DATABASE [FBDatabase] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO

ALTER DATABASE [FBDatabase] SET TRUSTWORTHY OFF 
GO

ALTER DATABASE [FBDatabase] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO

ALTER DATABASE [FBDatabase] SET PARAMETERIZATION SIMPLE 
GO

ALTER DATABASE [FBDatabase] SET  READ_WRITE 
GO

ALTER DATABASE [FBDatabase] SET RECOVERY FULL 
GO

ALTER DATABASE [FBDatabase] SET  MULTI_USER 
GO

ALTER DATABASE [FBDatabase] SET PAGE_VERIFY CHECKSUM  
GO

ALTER DATABASE [FBDatabase] SET DB_CHAINING OFF 
GO




-- Create the data table: [FaceBookAlerts]
USE [FBDatabase]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[FaceBookAlerts](
	[FaceBookID] [int] NOT NULL,
	[Name] [nvarchar](50) NULL,
	[unreadmsg] [int] NULL,
	[mostrecentmsg] [int] NULL,
	[unreadpoke] [int] NULL,
	[mostrecentpoke] [int] NULL,
	[unreadshare] [int] NULL,
	[mostrecentshare] [int] NULL,
	[friendrequests] [int] NULL,
	[groupinvites] [int] NULL,
	[eventinvites] [int] NULL,
	[mostrecentmsgtime] [datetime] NULL,
	[mostrecentpoketime] [datetime] NULL,
	[mostrecentsharetime] [datetime] NULL,
	[friendrequeststime] [datetime] NULL,
	[groupinvitestime] [datetime] NULL,
	[eventinvitestime] [datetime] NULL,
 CONSTRAINT [PK_FaceBookAlerts] PRIMARY KEY CLUSTERED 
(
	[FaceBookID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO